import React from 'react';
import { Link } from 'react-router-dom'


function Index() {
    const state = {
        list: [
            {cid: 123, title: '个人掘金'},
            {cid: 1231, title: '个人blog'},
            {cid: 1232, title: '个人git'}
        ]
    }

    return (
        <div>
            {/* <Navigate to='/home'></Navigate> */}
        <ul>
            {
                state.list.map((item, index) => {
                    return <li key={index}>
                        <Link to={'/list/'+item.cid}>{item.title}</Link>
                    </li>
                })
            }
        </ul>
        </div>
    )
}

// class Index extends Component {
//     constructor (props) {
//         super(props)
//         this.state = {}
//     }
//     state = {  } 
//     render() { 
//         return (
//             <h2>Home-page</h2>
//         );
//     }
// }
 
export default Index;